#include "test.hpp"
#include "object.hpp"
#include <string>

using std::string;

namespace vimock {
TEST_CASE(equals_test)
{
	object i(1);
	assert_is_true(i.equals(1));
	assert_is_false(i.equals(2));
	string str("Hello");
	assert_is_false(i.equals(str));
}

TEST_CASE(copy_constructor_test)
{
	object i(1);
	object j = i;
	assert_is_true(j.equals(1));
}

TEST_CASE(to_should_return_value_of_that_type_when_type_match)
{
	object i(1);
	int j(i.to<int>());
	assert_are_equal(1, j);
}

TEST_CASE(to_should_throw_bad_object_cast_exception_when_type_mismatch)
{
	object i(1);
	assert_thrown(bad_object_cast, i.to<string>());
}
}
